/**
 * @author chenjian2@staff.sina.com.cn
 */
$Import('kit.dom.parseDOM');
$Import('app.trans.tree');
$Import('app.ui.tree');
$Import('app.act.tree');
STK.register('app.mod.tree', function($){
	return function(node,opts){
		var that	= {},nodes,dEvent,treeAjax,treeUI,treeAct;
		opts.data = [{id:'1',type:'folder',path:'root',name:'root',childs:[{id:'1',type:'folder',path:'root/data1',name:'data1',childs:[]}]}];
		var bindDOMFuns = {
		};
		var delegatedEvent = {
			
		};
		var bindDOM = function(){
			treeAjax = app.ajax.tree(opts);
			treeUI = $.app.ui.tree(node,opts);
			treeAct = $.app.act.tree(node,opts);
		};
		var argsCheck = function(){
			if (!$.core.dom.isNode(node)) {
				throw "[STK.mod.tree]:node is not a Node!";
			}
		};
		
		var bindListener = function(){
		};
		
		var destroy = function(){
			bindDOMFuns = nodes = null;
		};
		var init = function(){
			argsCheck();
			bindDOM();
			bindListener();
		};
		node && init();
		that.destroy = destroy;
		return that;

	};
});